#ifndef SOCKET_H
#define SOCKET_H

#include "common.h"

# ifdef __cplusplus
extern "C" {
# endif

typedef enum socket_cmd_e {
	SOCKETCMD_SETUP = 1,
	SOCKETCMD_NONE,
} socket_cmd_t;

typedef struct socket_packet {
	int cmd_type;
	int src_socket_desc;
	int dist_socket_desc;
    long int serial_num;
	int data_len;
	char data[STRING_2MAX_LENGTH];
} socket_packet;

int SocketCommon_string2packet(char* string, socket_packet* sp, char* unhandledString);
int SocketCommon_packet2string(socket_packet* sp, char* string);

# ifdef __cplusplus
}
#endif

#endif // SOCKET_H
